import { DrawerProps } from "antd"
import { useState } from "react"

export function useDrawer(_title: string) {
    const [open, setOpen] = useState<boolean>(false)
    const [title, setTitle] = useState<string>(_title)

    const props: DrawerProps = {
        open,
        title,
        placement: 'right',
        onClose: () => setOpen(false),
        destroyOnClose: true,
    }
    return {
        props,
        setOpen,
        setTitle
    }
}